//
//  MapPackCustomCell.m
//  GoMap
//
//  Created by jsheriff on 2/8/11.
//  Copyright 2011 The MITRE Corporation. All rights reserved.
//

#import "MapPackCustomCell.h"


@implementation MapPackCustomCell

@synthesize nameLabel;
@synthesize layersLabel;
@synthesize zoomLabel;
@synthesize selectedImageView;
@synthesize thumbnailImageView;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]) {
		// Initialization code
		nameLabel = [[UILabel alloc]init];
		nameLabel.textAlignment = UITextAlignmentLeft;
		nameLabel.font = [UIFont boldSystemFontOfSize:22];
		
		layersLabel = [[UILabel alloc] init];
		layersLabel.textAlignment = UITextAlignmentLeft;
		layersLabel.font = [UIFont systemFontOfSize:14];
		
		zoomLabel = [[UILabel alloc] init];
		zoomLabel.textAlignment = UITextAlignmentLeft;
		zoomLabel.font = [UIFont systemFontOfSize:14];
		
//		selectedImageView = [[UIImageView alloc] init];
		
		thumbnailImageView = [[UIImageView alloc] init];
		
		[self.contentView addSubview:nameLabel];
		[self.contentView addSubview:layersLabel];
		[self.contentView addSubview:zoomLabel];
//		[self.contentView addSubview:selectedImageView];
		[self.contentView addSubview:thumbnailImageView];
		
		self.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
	}
	return self;
}

- (void)layoutSubviews {
	[super layoutSubviews];
	CGRect contentRect = self.contentView.bounds;
	CGFloat boundsX = contentRect.origin.x;
	CGRect frame;
	
//	frame= CGRectMake(boundsX + 10, 10, 50, 50);
//	selectedImageView.frame = frame;
	
	frame= CGRectMake(boundsX + 10, 10, 63, 63);
	thumbnailImageView.frame = frame;
	
	frame= CGRectMake(boundsX + 83, 10, 200, 24);
	nameLabel.frame = frame;
	
	frame= CGRectMake(boundsX + 83, 39, 180, 15);
	layersLabel.frame = frame;
	
	frame= CGRectMake(boundsX + 83, 59, 180, 15);
	zoomLabel.frame = frame;
}

/*
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]) {
		// Initialization code
		nameLabel = [[UILabel alloc]init];
		nameLabel.textAlignment = UITextAlignmentLeft;
		nameLabel.font = [UIFont boldSystemFontOfSize:28];
		
		layersLabel = [[UILabel alloc] init];
		layersLabel.textAlignment = UITextAlignmentLeft;
		layersLabel.font = [UIFont systemFontOfSize:14];
		
		zoomLabel = [[UILabel alloc] init];
		zoomLabel.textAlignment = UITextAlignmentLeft;
		zoomLabel.font = [UIFont systemFontOfSize:14];
		
		selectedImageView = [[UIImageView alloc] init];
		
		thumbnailImageView = [[UIImageView alloc] init];
		
		[self.contentView addSubview:nameLabel];
		[self.contentView addSubview:layersLabel];
		[self.contentView addSubview:zoomLabel];
		[self.contentView addSubview:selectedImageView];
		[self.contentView addSubview:thumbnailImageView];
	}
	return self;
}

- (void)layoutSubviews {
	[super layoutSubviews];
	CGRect contentRect = self.contentView.bounds;
	CGFloat boundsX = contentRect.origin.x;
	CGRect frame;
	
	frame= CGRectMake(boundsX + 10, 10, 50, 50);
	selectedImageView.frame = frame;
	
	frame= CGRectMake(boundsX + 220, 10, 80, 80);
	thumbnailImageView.frame = frame;
	
	frame= CGRectMake(boundsX + 70, 15, 150, 36);
	nameLabel.frame = frame;
	
	frame= CGRectMake(boundsX + 10, 68, 200, 15);
	layersLabel.frame = frame;
	
	frame= CGRectMake(boundsX + 10, 85, 200, 15);
	zoomLabel.frame = frame;
}
 */

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
	[super setSelected:selected animated:animated];
	// Configure the view for the selected state
}

@end
